﻿using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;

public partial class ChucNang_Admin_Admin_ThongKeDoanhThuSanPhamTheoThang : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void btnThongKe_Click(object sender, EventArgs e)
    {
        DataDSTableAdapters.LOHANGTableAdapter adapter = new DataDSTableAdapters.LOHANGTableAdapter();
        DataDSTableAdapters.DOITACTableAdapter dtadapter = new DataDSTableAdapters.DOITACTableAdapter();
        DataDS.DOITACDataTable dttable = new DataDS.DOITACDataTable();
        int id_doitac=int.Parse(dropdownlistDoiTac.SelectedValue.ToString());
        int nam=int.Parse(dropdownNam.SelectedValue.ToString());
        dttable=dtadapter.DOITAC_LayDoiTacTheoId(id_doitac);
        imgDoiTac.ImageUrl=dttable.Rows[0]["Logo"].ToString();
        imgDoiTac.DataBind();
        if (dropdownlistDoiTac.SelectedValue != null && dropdownNam.SelectedValue != null)
        {

            GridView1.DataSource = adapter.LOHANG_ThongKeDoanhThuDoiTacTheoThang(nam,id_doitac);
            GridView1.DataBind();
        }
        else
        {
            if (dropdownlistDoiTac.SelectedValue != null)
            {
                GridView1.DataSource = adapter.LOHANG_ThongKeDoanhThuDoiTacTheoThang(DateTime.Now.Year,id_doitac);
                GridView1.DataBind();
            }
        }

    }
}
